<template>
  	<el-dialog class="modify-class" width="1200px" :title="title" visible append-to-body :close-on-click-modal="false" :before-close="beforeClose">
	  	<c-table class="mt20 mb20" @mediaIds="lookMedia" @signId="donwIMG" :table-column="tableColumn" :table-data="detailData" :operation="false"></c-table>
  	</el-dialog>
</template>

<script>
export default {
  	props: {
    	detailData: {
      		type: Array,
      		default() {
        		return []
      		}
    	},
        title: {
      		type: String,
      		default() {
        		return ''
      		}
    	},
  	},
  	data() {
	    return {
	      	tableColumn: {
		        testProject: {
		          	label: '测试项目',
		          	columnProp: {
		            	align: 'center'
		          	}
		        },
		        testMethod: {
		            label: '测试方法',
		          	columnProp: {
		            	align: 'center'
		          	}
		        },
		        testJudge: {
		            label: '合格判据',
		          	columnProp: {
		            	align: 'center'
		          	}
		        },
		        dataTxt: {
		          	label: '数据记录',
		          	columnProp: {
		            	align: 'center'
		          	}
		        },
				recordTxt: {
		          	label: '记录试验条件',
		          	columnProp: {
		            	align: 'center'
		          	}
		        },
		        qualified: {
		          	label: '是否合格',
		          	columnProp: {
		            	align: 'center',
						formatter: this.qualifiedFormatter
		          	},
		        },
				mediaIds: {
					type: 'link',
		          	label: '多媒体记录',
					text: '查看',
		          	columnProp: {
		            	align: 'center'
		          	},
		        },
                signName: {
		            label: '操作人/时间',
		          	columnProp: {
		            	align: 'center'
		          	}
		        },
                signId: {
		            type: 'link',
		          	label: '电子签名',
          			text: '查看',
		          	columnProp: {
		            	align: 'center'
		          	},
		        },
	      	}
	    }
  	},
  	methods: {
    	beforeClose() {
      		this.$emit("close")
    	},
		qualifiedFormatter(e) {
			return e.qualified.message
		},
		donwIMG(row){
			this.openFile(row)
		},
		// 打开文件
		openFile(row) {
			let url = process.env.VUE_APP_BASE_API + '/dlapi/attach/download?attachId=' + row.signId
			this.$imageView([url])
		},
		lookMedia(row) {
			let url = process.env.VUE_APP_BASE_API + '/dlapi/attach/download?attachId=' + row.mediaIds
			this.$imageView([url])
		}
  	},
	 
}
</script>
